package com.andeveloper.springdemo.common;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;

public class SessionUtil {
	public static boolean isLogin(HttpServletRequest request) {
		String userName = getUserName(request);
		if(StringUtils.isEmpty(userName)) {
			return false;
		}
		return true;
	}
	
	public static String getUserName(HttpServletRequest request) {
		String userName = (String) request.getSession().getAttribute("userName");
		return userName;
	}
}
